import http from "../../utils/requestAI";
import type { cityData, Company,CompanyList, CompanyParams } from "./type";


// 获取列表
export const getCompanys = (params?: CompanyParams) => {

    return http.get<CompanyList>('/company/list', params);
}

// 单删
export const delCompany = (id: number) => {

    console.log('删除1111', id);

    return http.delete(`/company/delete/${id}`);

}

// 批删
export const delCompanys = (ids: number[]) => {

    console.log('删除222', ids);
    return http.post(`/company/deleteAll/`, ids);

}

// 获取城市信息
export const getCity=()=>{
    return  http.get<cityData>('/company/getCity');
  }

// 添加/修改机构
export const addCompany = (data:Company) => {
    // console.log('添加', data);
    return http.post(`/company/add`, data);

}

// 获取单条机构信息
export const getCompany = (id: number) => {
    // console.log('添加', data);
    return http.get<Company>(`/company/get/${id}`);
}


